# -*- coding: utf-8 -*-
"""
Created on Mon Sep 10 11:35:58 2012

@author: xudi
"""

import numpy as np
import pylab as pl

   

wc=2.417e15

w0=wc
wp=wc
xl=1
E0=8.85e-12
Tao=0.01*wc
dt=6.75e-10
dw=2*np.pi/dt
size=2*wc/dw
w=np.arange(0,2*wc,dw)
ws=w[:size]
wsN=ws/(dw*size)*2
p=xl*(wp**2)/(w0**2-(ws**2)+(ws*Tao)*1j)

n=(1+p)**0.5
real=n.real
imag=n.imag
pl.plot(wsN,real,'b')
pl.plot(wsN,imag,'b--')
pl.xlabel("Normalized driving frequence (Hz)")
pl.ylabel("Refractive inedx")
pl.legend((u"real","imag "))
pl.grid(True)
pl.show()
